package online.shenme.day14_self.domin;

public class Manager {
    @java.io.Serial
    private static final long serialVersionUID = 1L;
    private String id;
    private String name;
    private char sex;
    private Long tel;

    public Manager() {
    }

    public Manager(String id, String name, char sex, Long tel) {
        this.id = id;
        this.name = name;
        this.sex = sex;
        this.tel = tel;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public char getSex() {
        return sex;
    }

    public void setSex(char sex) {
        this.sex = sex;
    }

    public Long getTel() {
        return tel;
    }

    public void setTel(Long tel) {
        this.tel = tel;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Manager manager = (Manager) o;

        if (sex != manager.sex) return false;
        if (id != null ? !id.equals(manager.id) : manager.id != null) return false;
        if (name != null ? !name.equals(manager.name) : manager.name != null) return false;
        return tel != null ? tel.equals(manager.tel) : manager.tel == null;
    }

    @Override
    public int hashCode() {
        int result = id != null ? id.hashCode() : 0;
        result = 31 * result + (name != null ? name.hashCode() : 0);
        result = 31 * result + (int) sex;
        result = 31 * result + (tel != null ? tel.hashCode() : 0);
        return result;
    }

    @Override
    public String toString() {
        return "Manager{" +
                "id='" + id + '\'' +
                ", name='" + name + '\'' +
                ", sex=" + sex +
                ", tel=" + tel +
                '}';
    }
}
